package com.treasure.mall.biz.config;

import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.convert.Jsr310Converters;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * @author allan
 * @date 2019-10-12
 */
@Configuration
@EnableJpaAuditing
@EntityScan(basePackageClasses = {Jsr310Converters.class}, basePackages = "com.treasure.mall.biz")
@EnableJpaRepositories(basePackages = "com.treasure.mall.biz.repository")
public class BizConfig {
    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }
}
